package com.aaa.service.impl;

import com.aaa.dao.F_MenuDao;
import com.aaa.entity.F_Menu;
import com.aaa.service.F_MenuService;
import com.aaa.util.EmpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class F_MenuServceimpl implements F_MenuService {
    @Autowired
    F_MenuDao dao;
    @Override
    /**
     * 菜单查询
     */
    public List<F_Menu> selectList() {
        return dao.selectList();
    }

    /**
     * 添加一级菜单
     * @param map
     * @return
     */
    @Override
    public int add(Map map) {
        return dao.add(map);
    }

    @Override
    public int InsertErji(Map map) {
        return dao.InsertErji(map);
    }




    @Override
    public int updateErji(Map map) {
        return dao.updateErji(map);
    }

    @Override
    public int del(Integer id) {
        return dao.del(id);
    }

    @Override
    public int getRoleid() {
        //根据session获取用户名
      String username= EmpUtil.getEmp().getUsername();
       // String password= EmpUtil.getEmp().getPassword();

        return dao.getRoleid(username);
    }

    @Override
    public List<F_Menu> selectListid(int roleid) {
        //System.out.println(roleid);
        return dao.selectListid(roleid);
    }

    @Override
    public String getstate() {
        //根据session获取用户名
        String username= EmpUtil.getEmp().getUsername();
        // String password= EmpUtil.getEmp().getPassword();

        return dao.getstate(username);
    }


}
